<? session_start();
require_once 'lib/common_function.php';
require_once 'lib/connect.php';

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home</title>
<link rel="stylesheet" type="text/css" href="assets/css/layout-default-latest.css" />
<link rel="stylesheet" type="text/css" href="assets/css/jquery.flipflopfolding.css" />
<link rel="stylesheet" type="text/css" href="assets/css/barcode-font.css" />
<style type="text/css">@import url("asset/css/pesan.css");</style>
<style type="text/css">@import url("asset/css/jquery.ui.css");</style>
<style type="text/css">@import url("asset/css/jquery.ui.datepicker.css");</style>
<link rel="stylesheet" type="text/css" href="assets/css/jquery.partsselector.css" media="all" />
<link rel="stylesheet" type="text/css" href="assets/css/base.css" media="all" />
<link rel="stylesheet" type="text/css" href="assets/css/button.css"  />
<link rel="stylesheet" type="text/css" href="assets/css/tipsy.css" media="all" />
<link rel="stylesheet" type="text/css" href="assets/css/tipsy-docs.css" media="all" />    
<link rel="stylesheet" type="text/css" href="assets/css/base/ui.all.css" media="all" />
<link rel="stylesheet" type="text/css" href="assets/css/style.css" media="all" />
<link rel="stylesheet" type="text/css" href="assets/css/jquery.autocomplete.css" media="all" />
<link rel="stylesheet" type="text/css" href="assets/css/jquery.overlay.css" media="all" />
<link rel="stylesheet" type="text/css" href="assets/css/jquery.multiselect2side.css" media="all" />
<link rel="stylesheet" type="text/css" href="assets/css/jquery.fancybox-1.3.4.css" media="all" />

<script type="text/javascript" src="assets/js/jquery-1.6.2.js"></script>
<script type="text/javascript" src="assets/js/jquery-ui-1.8.11.custom.min.js"></script>

<script type="text/javascript" src="assets/js/jquery.tools.min.js"></script>
<script type="text/javascript" src="assets/js/jquery-ui-latest.js"></script>
<script type="text/javascript" src="assets/js/jquery.layout-latest.js"></script>
<script type="text/javascript" src="assets/js/config.js"></script>
<script type="text/javascript" src="assets/js/jquery.tipsy.js"></script>
<script type="text/javascript" src="assets/js/jquery.flipflopfolding.js"></script>
<script type="text/javascript" src="assets/js/validation_form.js"></script>
<script type="text/javascript" src="assets/js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="assets/js/jquery.partsselector.js"></script>
<script type="text/javascript" src="assets/js/jquery.zclip.js"></script>
<script type="text/javascript" src="assets/js/jquery.fancybox-1.3.4.pack.js"></script>
<script src="assets/js/jquery.ui.widget.js"></script>
<script src="assets/js/jquery.ui.button.js"></script>
<script src="assets/js/jquery.ui.position.js"></script>
<script src="assets/js/jquery.ui.menu.js"></script>
<script src="assets/js/jquery.ui.tooltip.js"></script>
<script type="text/javascript" src="assets/js/library.js"></script>

<script type="text/javascript" src="assets/js/custom/ui.attribut.js"></script>
<script type="text/javascript" src="assets/js/jquery.ui.core.js"></script>
<script type="text/javascript" src="assets/js/jquery-ui-1.8.16.custom.js"></script>
<script type="text/javascript" src="assets/js/jquery.ui.accordion.js"></script>
<script type="text/javascript" src="assets/js/common-function.js"></script>
<script type="text/javascript" src="assets/js/custom/dialog.js"></script>
<script src="assets/js/ui/jquery.ui.tabs.js"></script>
<script type="text/javascript">
        $(function() {
		$('#tanggal').datepicker({
			changeMonth: true,
			changeYear: true
		});
	});

  var myLayout, $westAccordion, $eastAccordion;
  $(document).ready(function () {
    myLayout = $('body').layout({
    east__spacing_closed      : 0,
    west__spacing_closed      : 15,
    west__togglerAlign_closed : "top",
    west__togglerLength_closed: 15,
    west__togglerLength_open: 0,
    west__togglerTip_closed   : "Buka Menu",
    west__togglerTip_open     : "Tutup Menu"
    });
    myLayout.disableClosable("north",true);
    myLayout.disableResizable("north");
    myLayout.disableClosable("south",true);
    myLayout.disableResizable("south");
    myLayout.close("east",false,true);
  
    var westSelector = "body > .ui-layout-west"; // outer-west pane

     // CREATE SPANs for close-buttons - using unique IDs as identifiers
    $("<span></span>").attr("id", "west-closer" ).prependTo( westSelector );
    // BIND layout events to close-buttons to make them functional
    myLayout.addCloseBtn("#west-closer", "west");
    
    $('.active').not('.logout').parent().parent().prev().toggleClass('expand active navigasi');
    /* Fungsi mengatur panel layout barat sampai disini*/ 
    $('.navigation').flipflopFolding();
});

<!-- 
//Disable right click script 
//visit http://www.rainbow.arch.scriptmania.com/scripts/ 
var message="Sorry, right-click has been disabled"; 
/////////////////////////////////// 
function clickIE() {if (document.all) {(message);return false;}} 
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) { 
if (e.which==2||e.which==3) {(message);return false;}}} 
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 
document.oncontextmenu=new Function("return false") 
// --> 

function removeHtmlTag(strx){
if(strx.indexOf("<")!=-1)
{
    var s = strx.split("<");
    for(var i=0;i<s.length;i++){
    if(s[i].indexOf(">")!=-1){
    s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
    strx = s.join(" ");
}
    return strx;
}
</script>
</head>
<body>
    <div class="ui-layout-north hide" onmouseover="myLayout.allowOverflow('north')" onmouseout="myLayout.resetOverflow(this)" style="">
<!--            <div class="logo">&nbsp;</div>-->
<?
$proyek=  _select_arr('select * from project');
?>
<div class="grid">
    <div style="text-align: left;width: 70%">
        <div style="height: 20px">
            <div id="message">
        
            </div>
        </div>
    </div>
    <div style="text-align: right;width: 25%">
        <form action="index.php" metho="GET"> 
            <select name="project" onchange="submit();">
                <option value="">- Pilih Proyek -</option>
                <? foreach ($proyek as $p): ?>
                    <option value="<?= $p['ID_pro'] ?>" <?=(isset($_GET['project']) && $_GET['project']==$p['ID_pro'])?'selected':''?>><?= $p['pro_name'] ?></option>
                <? endforeach; ?>
            </select>
        </form>
    </div>
</div>
        </div>
        <div class="ui-layout-west">
            <div class="header">Main Menu</div>
            <div class="content">
                <div class="account">
                    <b>Administrator</b>
                    <br>Username :<b>admin</b>
                    <br>As :<b>admin</b>    
                    <br><br><a href='login/logout' class='logout'>Logout</a>    
                </div>
                <ul class="navigation flipflopfolding">
                    <li>
                        <a class="active logout" href="index.php">Home</a>
                    </li>
                    <?
                    $menu=require_once 'menu.php';
                    foreach($menu as $m){
                        ?><li>
                            <?
                            if(isset($m['link'])){
                                ?><a class="navigasi collapse" href="?page=<?=$m['link']?>"><?=$m['modul']?></a><?
                            }else{
                                ?><a class="navigasi collapse" href="#"><?=$m['modul']?></a><?
                            }
                            
                            if(isset($m['sub']) && count($m['sub'])>0){
                                ?>
                                <ul style="display: none;">
                                    <li>
                                        <? foreach ($m['sub'] as $sub) {
                                            ?> <a href="?page=<?= $sub['link'] ?>"><?= $sub['title'] ?></a>
                                        <? } ?>
                                    </li>
                                </ul>  
                                <?
                            }
                            ?>
                        </li><?
                    }
                    ?>
                </ul>
            </div>
        </div>
        <div class="ui-layout-center">
            <?
            if(!empty($_GET['page']) && file_exists(''.$_GET['page'].'.php')){
                include ''.$_GET['page'].'.php';
            }else{
            ?>
            <div class=judul>Home</div><h2>Selamat Datang di Sistem Informasi Kedaulatan Rakyat</h2>
            <?}
            include 'show_message.php';
            ?>
        </div>
        <div class="ui-layout-south hide">
            <center>Copyright &copy; 2011 <a href="http://erpie.org" target="_blank">Rabiha Pilar Informatika</a> All rights reserved.</center>
        </div>
    
    <script type="text/javascript">
        $(document).ready(function(){
            $("input[autocomplete=off]").bind('paste',function(e){
                return false;
            });
            var a_link=$('a');
            for(var i=0;i<a_link.length;i++){
                $('a:eq('+i+')').attr('href',$('a:eq('+i+')').attr('href')+'&project=<?=$_GET['project']?>');
            }
            var a_link=$('form');
            for(var i=0;i<a_link.length;i++){
                $('form:eq('+i+')').attr('action',$('form:eq('+i+')').attr('action')+'&project=<?=$_GET['project']?>');
            }
        })
    </script>
    </body>
</html>